package com.greate.community.service;

import com.greate.community.entity.LoginTicket;
import com.greate.community.entity.User;
import com.greate.community.util.CommunityConstant;
import org.springframework.security.core.GrantedAuthority;

import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Map;

public interface UserService extends CommunityConstant {
    User findUserById (int id);
    User findUserByName(String account);
    Map<String, Object> register(User user);
    int activation(int userId, String code);
    Map<String, Object> login(String account, String password, int expiredSeconds);
    void logout(String ticket);
    LoginTicket findLoginTicket(String ticket);
    int updateHeader(int userId, String headUrl);
    int updatePassword(int userId, String newPassword);
    Collection<? extends GrantedAuthority> getAuthorities(int userId);
    Map<String, Object> doSendEmailCode4ResetPwd(String account);
    Map<String, Object> doResetPwd(String account, String password);
    List<User> getAllUsers();

    void updateStatus(Integer userId, Integer status);

    List<User> getUsersByParams(String username, String schoolName, String email, String status, String startTime, String endTime);

    User getUserByName(String username);

    User getUserById(int id);

    List<User> getUsersByName(String candidateName);
}
